home *** CD-ROM | disk | FTP | other *** search
- ; This example demonstrates different
- ; ways to use the SRAMs in the EPX780.
- ;
- ; SET COMPILER OPTIONS TO:
- ; Use Design Pin Assignments, but not
- ; Previous, Abort on no fit
-
- CHIP product NFX780_84
-
- PIN 3 CLK1 ; synchronous clock pin 1
- PIN 45 CLK2 ; synchronous clock pin 2
-
- PIN a[0:6] ; address pins
- PIN d[9:0] ; data pins
- PIN we_ ; write enable
- PIN oe_ ; output enable
- PIN be_ ; block enable
-
- PIN rama[3:0] RAM ; a 128x4 SRAM
- PIN ramb[9:0] RAM REG ; a 128x10 SRAM
- ; with registered outputs
-
- ; initialize all locations in SRAM
- ; rama with 0x4 and then load the first
- ; location with 0x3 and the next fifteen
- ; locations with 0x7
- RAM_DEFAULTS rama DEFAULT_VALUE 0x4
- 0x00 : 0x3
- [0x01:0x0F] : 0x7
-
- ; initialize all locations in SRAM
- ; ramb with 0x3FF and then load the first
- ; sixteen locations with zero
- RAM_DEFAULTS ramb DEFAULT_VALUE 0x3FF
- [0x00:0x1F] : 0x0
-
- EQUATIONS
-
- ; use only the first 32 locations of rama
- rama[4:0].ADDR = a[4:0]
- ; connect only four data inputs to rama
- rama[3:0].DATA = d[3:0]
- ; always enable rama
- /rama.BE = GND;
- ; make rama into a read-only memory
- rama.WE = GND
- ; always enable memory output from rama
- rama.TRST = VCC
-
- ; use all the locations
- ramb[6:0].ADDR = a[6:0]
- ; use all the data inputs
- ramb[9:0].DATA = d[9:0]
- ; connect write, block, and output enables
- /ramb.WE = we_
- /ramb.BE = be_
- /ramb.TRST = oe_
- ; clock ram outputs into register on the
- ; rising edge of CLK1
- ramb.CLKF = CLK1
-
- SIMULATION
- VECTOR address := [a6,a5,a4,a3,a2,a1,a0]
- SETF we_ /be_ /oe_ /CLK1
- FOR i:=0 TO 40 DO
- BEGIN
- SETF address := i
- CLOCKF CLK1
- END
-